package de.game.actor.tower;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import de.core.utils.ImageUtils;
import de.game.actor.tower.projectile.AbstractProjectile;
import de.game.actor.tower.projectile.TestBullet;

public class TestTower extends AbstractTower {

    public TestTower(int aX, int aY) {
        super(createTurretImage(), createBackgroundImage(), 350, 1000, 10, aX, aY);
    }

    protected static BufferedImage createBackgroundImage() {
        BufferedImage image = ImageUtils.createCompatibleImage(32, 32);
        Graphics graphics = image.getGraphics();
        graphics.setColor(new Color(120, 120, 120));
        graphics.fillRect(0, 0, 32, 32);
        graphics.dispose();
        return image;
    }

    protected static BufferedImage createTurretImage() {
        BufferedImage image = ImageUtils.createCompatibleImage(16, 16);
        Graphics graphics = image.getGraphics();
        graphics.setColor(new Color(66, 255, 66));
        graphics.fillRect(0, 0, 16, 16);
        graphics.setColor(new Color(0, 0, 0));
        graphics.fillRect(0, 0, 16, 8);
        graphics.dispose();
        return image;
    }

    @Override
    public void upgrade() {
    }

    @Override
    protected AbstractProjectile createNewProjectile() {
        return new TestBullet(getRotation(), (int) getLocation().getX(), (int) getLocation().getY());
    }

}
